<?php
session_start();
include 'include/db_connect.php';
connect();
$sql="SET CHARACTER SET UTF8";   
query($sql);
include 'include/try_session_login.php';
include 'include/Browser.php';
$browser = new Browser();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Administrator System</title>
<link href="css/admin-style.css" rel="stylesheet" type="text/css" />
<link href="css/admin-ui/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
<style>
ul#icons {margin: 0; padding: 0;}
ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}
ul#icons span.ui-icon {float: left; margin: 0 4px;}
</style>
<script>
function fgbutton(){
	$(".fg-button:not(.ui-state-disabled)")
		.hover(
			function(){ 
				$(this).addClass("ui-state-hover"); 
			},
			function(){ 
				$(this).removeClass("ui-state-hover"); 
			}
		)
		.mousedown(function(){
				$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
				if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
				else { $(this).addClass("ui-state-active"); }	
		})
		.mouseup(function(){
			if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button') ){
				$(this).removeClass("ui-state-active");
			}
		});
}
	$(function() {
		$( "input:submit").button();
		
		$( "input:submit, a, button", "#nav" ).button();
		
	
	$("#nav li").hover(function(){
    	$(this).find("span").toggleClass("ui-icon-folder-open");
		$(this).find("span:last").toggleClass("pink13");
  	});
	
	$( "#tabs" ).tabs();
	
	$("#logout").click(function(){
		$("#dialog_delete").dialog({
			modal: true,
			buttons: {
				ตกลง: function() {
						window.location='logout.php';
					},
				ยกเลิก:function() {
						$( this ).dialog( "close" );
					}
			}
		});
	});
	
	
				
});
	</script>
</head>
<body>
<div id="dialog_delete" title="Message"  style="display:none;">
	<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>ยืนยันออกจากระบบ</p>
</div>
<div id="dialog" title="Message"  style="display:none;">
	<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><span id="msg" class="formlb"></span></p>
</div>
	<div id="wrapper">
    	<div class="ui-widget-header" id="header" style="position:relative;">
        	<ul id="icons" class="ui-widget ui-helper-clearfix">
            	<li>Website Control Panel</li>
				<li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-home"></span></li>
                <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-wrench"></span></li>
                <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-gear"></span></li>
                <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-mail-closed"></span></li>
                <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-comment"></span></li>
                <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-document"></span></li>
                <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-plusthick"></span></li>    
                <div style="clear:both;"></div>
          </ul>
          <div class="profile">
          	<ul>
            	<li>ยินดีต้อนรับ</li>
                <li><span class="ui-icon ui-icon-person" style="float:left;"></span><?=$_SESSION['admin_name']?></li>
                <li><span class="ui-icon ui-icon-power" style="float:left;"></span><a id="logout" href="javascript:void(0);">ออกจากระบบ</a></li>
            </ul>
           </div>
        </div>
      <div class="ui-state-default company"><span style="font-weight:normal;">Central Insurance Broker</span></div>
      <div class="ui-widget-content" id="nav" >
      		<ul>
            	<li><a href="admin.php"><span class="ui-icon ui-icon-home" style="float:left;"></span>ภาพรวม</a></li>
               <!-- <li><a href="admin.php?page=center"><span class="ui-icon ui-icon-home" style="float:left;"></span>ศูนย์</a></li>-->
                <li><a href="admin.php?page=member"><span class="ui-icon ui-icon-person" style="float:left;"></span>สมาชิก</a></li>
                <li><a href="admin.php?page=class"><span class="ui-icon ui-icon-person" style="float:left;"></span>ระดับสมาชิก</a></li>
                <li><a href="admin.php?page=firstclass_inquiry"><span class="ui-icon ui-icon-comment" style="float:left;"></span>สอบถามประกันชั้น 1</a></li>
                <li><a href="admin.php?page=order"><span class="ui-icon ui-icon-suitcase" style="float:left;"></span>สั่งซื้อประกัน</a></li>
                <li><a href="admin.php?page=insure"><span class="ui-icon ui-icon-folder-collapsed" style="float:left;"></span>ประกันภัย</a></li>
                <li><a href="admin.php?page=news"><span class="ui-icon ui-icon-clipboard" style="float:left;"></span>ข่าวสาร</a></li>
                <li><a href="admin.php?page=report"><span class="ui-icon ui-icon-clipboard" style="float:left;"></span>รายงานการขาย</a></li>
                <li><a href="admin.php?page=expire"><span class="ui-icon ui-icon-clipboard" style="float:left;"></span>แจ้งประกันหมดอายุ</a></li>
                <li><a href="admin.php?page=user"><span class="ui-icon ui-icon-person" style="float:left;"></span>จัดการผู้ใช้</a></li>
            </ul>
            <div style="clear:both;"></div>
      </div>
      <div id="container">
       	  <?php $mode=$_GET[page];if(empty($mode)){ ?>
     	<div id="tabs">
            	<ul>
                  <li><a class="head_tab" style="padding-left:7px;" href="#tabs-1"><span class="ui-icon ui-icon-home" style="float:left;"></span>ภาพรวม</a></li>
				</ul>
                <div id="tabs-1">
                	<table width="30%" border="1" align="center" cellpadding="3" cellspacing="0" style="border-collapse:collapse;" bordercolor="#e1e1e1">
                      <tr>
                        <td width="47%" class="ui-state-default">ชื่อผู้ใช้</td>
                        <td width="53%"><?=$_SESSION['admin_username']?></td>
                      </tr>
                      <tr>
                        <td class="ui-state-default">อีเมลล์</td>
                        <td><?=$_SESSION['admin_email']?></td>
                      </tr>
                      <tr>
                        <td class="ui-state-default">IP Address</td>
                        <td><?php echo $_SERVER["REMOTE_ADDR"];?></td>
                      </tr>
                      <tr>
                        <td class="ui-state-default">Browser</td>
                        <td><?=$browser->getBrowser();?> <?=$browser->getVersion(); ?></td>
                      </tr>
                      <tr>
                        <td class="ui-state-default">Platform</td>
                        <td><?=$browser->getPlatForm(); ?></td>
                      </tr>
                    </table>
          	</div>
       </div>                       
       <?php }else{  include("$mode".".php"); } ?> 
      </div>
      <div id="footer">Copyright © 2012 Central Insurance Broker Co.,Ltd. All rights reserved. Powered by <a target="_blank" class="link" href="http://www.show-idea.com/">Show-idea</a></div>
    </div>
</body>
</html>
